package wei.xinya.pattern.creational.Prototype;

public class Test {
    public static void main(String[] args) {
        Manager manager = new Manager();
        UnderlinePen underlinePen = new UnderlinePen('~');
        MessageBox mbox = new MessageBox('*');
        MessageBox sbox = new MessageBox('/');
        manager.register("Strong message", underlinePen);
        manager.register("Waring Box", mbox);
        manager.register("Slash Box", sbox);
        Product p1 = manager.create("Strong message");
        Product p11 = manager.create("Strong message");
        p11.use("hello world");
        Product p2 = manager.create("Waring Box");
        Product p22 = manager.create("Waring Box");
        p22.use("hello world");
        Product p3 = manager.create("Slash Box");
        Product p33 = manager.create("Slash Box");
        p33.use("hello world");
    }
}
